<!DOCTYPE html>
<html>

<head>
    <meta name="layout" content="main2"/>
    <g:set var="entityName" value="${message(code: 'workflowInstance.label', default: 'workflowInstance')}" />
    <title>工作流实例</title>
</head>

<body>

<div class="main-body">
    <div class="page-wrapper">
        <!-- Page-header start -->
        <div class="page-header">
            <div class="page-header-title">
                <h4>新增工作流实例</h4>
            </div>

            <div class="page-header-breadcrumb">
                <ul class="breadcrumb-title">
                    <li class="breadcrumb-item">
                        <a href="/salesDashboard/index">
                            <i class="icofont icofont-home"></i>
                        </a>
                    </li>
                    <li class="breadcrumb-item">
                        <g:link action="index" controller="project" action="show" id="${this.workflowInstance?.project?.id}">${this.workflowInstance?.project?.name}</g:link>
                    </li>
                    <li class="breadcrumb-item"><a href="#!">新增工作流实例</a>
                    </li>
                </ul>
            </div>
        </div>
        <!-- Page-header end -->
        <!-- Page-body start -->
        <div class="page-body">
        <g:if test="${flash.message}">
            <div class="message" role="status">${flash.message}</div>
        </g:if>
        <g:hasErrors bean="${this.workflowInstance}">
            <ul class="errors" role="alert">
                <g:eachError bean="${this.workflowInstance}" var="error">
                    <li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>><g:message error="${error}"/></li>
                </g:eachError>
            </ul>
        </g:hasErrors>
        <!-- Hover table card start -->
            <div class="card">
                <div class="card-header">
                    <h5>新增工作流实例</h5>

                    <div class="card-header-right">

                        <i class="icofont icofont-rounded-down"></i>
                    </div>
                </div>

                <div class="card-block">
                    <g:form action="save">

                        <div class="form-group row">
                            <label class="col-md-3 control-label is-required">工作流实例</label>

                            <div class="col-md-4">
                                <g:textField class="hidden" name="targetUri" value="${targetUri}"></g:textField>
                                <g:textField class="hidden" name="project.id"
                                             value="${this.workflowInstance?.project?.id}"/>
                                <g:select  class="form-control" name="workflow.id" id="workflow"
                                           value="${this.workflowInstance?.workflow?.id}" from="${com.next.Workflow.findAllByActive(true)}"
                                           optionKey="id" optionValue="name" noSelection="${['': '请选择']}"></g:select>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-md-3 control-label is-required">名称</label>

                            <div class="col-md-4">

                                <g:textField class="form-control" name="name" value="${this.workflowInstance?.name}"/>

                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-md-3 control-label">主工作流</label>

                            <div class="col-md-4">
                                        <g:select  class="form-control" name="parent.id" id="parent"
                                           value="${this.workflowInstance?.parent?.id}" from="${com.next.WorkflowInstance.list()}"
                                           optionKey="id" optionValue="name" noSelection="${['': '请选择']}"></g:select>
                            </div>
                        </div>


                        <div class="form-group row">
                            <div class="col-md-12">
                                <g:submitButton class="btn btn-info" name="update" value="保存"/>
                            </div>
                        </div>
                    </g:form>
                </div>
                <!-- Hover table card end -->
            </div>

            <!-- Page-body end -->
        </div>
    </div>
</div>

</body>

</html>
